import request from "@/apps/admin/units/request"
import {HttpResultData, HttpResultPaging, HttpResult} from "@/types/project";

/**
 * 职位权限
 * @type {{ADD: string, EDIT: string, DEL: string, VIEW: string}}
 */
export const PERMISSIONS: { [key: string]: string } = {
    VIEW: 'administer.job.list',
    ADD: 'administer.job.created',
    EDIT: 'administer.job.updated',
    DEL: 'administer.job.remove'
}


/**
 * 获取职位信息
 */
export const getJobListApi = (where: any): Promise<HttpResultPaging<any>> => request(`/administer-job/list`, where)


/**
 * 创建职位API
 */
export const createdJobApi: string = `/administer-job/created`


/**
 * 编辑职位API
 */
export const updatedJobApi: string = `/administer-job/updated`


/**
 * 删除职位
 */
export const removeJobApi = (id: number): Promise<HttpResultPaging<any>> => request(`/administer-job/remove`, {id}, 'POST')